import request from '/@/utils/request';

/**
 * 车辆管理相关接口
 */

// 分页查询
export function getVehiclePage(params) {
	return request({
		url: '/platform/vehicle/page',
		method: 'get',
		params,
	});
}

// 查询list
export function getVehicleList(params) {
	return request({
		url: '/platform/vehicle/list',
		method: 'get',
		params,
	});
}

// 新增车辆信息
export function addVehicle(data) {
	return request({
		url: '/platform/vehicle/save',
		method: 'post',
		data,
	});
}

// 修改车辆信息
export function updateVehicle(data) {
	return request({
		url: '/platform/vehicle/update',
		method: 'put',
		data,
	});
}

// 通过id查询车辆信息
export function getVehicleById(id) {
	return request({
		url: `/platform/vehicle/scrapById/${id}`,
		method: 'get',
	});
}

// 通过id报废车辆
export function scrapVehicleById(id) {
	return request({
		url: `/platform/vehicle/scrapById/${id}`,
		method: 'put',
	});
}

// 获取车队列表
export function getFleetList() {
	return request({
		url: '/platform/fleet/list',
		method: 'get',
	});
}
